package com.baiyun.service.impl;

import com.baiyun.entity.User;
import com.baiyun.mapper.LoginMapper;
import com.baiyun.service.LoginService;
import com.baiyun.utils.JwtUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
@RequiredArgsConstructor
@Slf4j
public class LoginServiceImpl implements LoginService {
    private final LoginMapper loginMapper;

    @Override
    public User login(String username, String password) {
        User user = null;
        try{
            user = loginMapper.login(username, password);
        }catch (Exception e){
            e.printStackTrace();
            log.error("发生了错误{}",e.getMessage());
        }
        return user;
    }
}

